package com.bean;


import java.util.Date;

public class Article {
    private int id;
    private String typename;
    private String title;
    private String content;
    private Date pubtime;
    private String picture;
    private String origin;//来源
    private int count;//浏览记录
    private int remark=0;//评论

    public int getRemark() {
        return remark;
    }

    public void setRemark(int remark) {
        this.remark = remark;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTypename() {
        return typename;
    }

    public void setTypename(String typename) {
        this.typename = typename;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public String getContent(int len){
        if(len<=0||len>content.length())
            len=content.length();
        return content.substring(0,len)+"...";
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getPubtime() {
        return pubtime;
    }

    public void setPubtime(Date pubtime) {
        this.pubtime = pubtime;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    public String getOrigin() {
        return origin;
    }

    public void setOrigin(String origin) {
        this.origin = origin;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    @Override
    public String toString() {
        return "Article{" +
                "id=" + id +
                ", typename='" + typename + '\'' +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", pubtime=" + pubtime +
                ", origin='" + origin + '\'' +
                ", count=" + count +
                '}';
    }
}
